home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
pstui100.zip
/
PTUI.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-02-16
|
13KB
|
379 lines
{
╔══════════════════╗
║ Text User ║
║ Interface ║
║ Rev. 1.00 ║
╚══════════════════╝
}
Unit PTUI;
{$F+} {$O-} {$A+} {$G+}
{$V-} {$B-} {$X-} {$N+} {$E+}
{$I FINAL.PAS}
{$IFDEF FINAL}
{$I-} {$R-}
{$D-} {$L-} {$S-}
{$ENDIF}
Interface
Uses CRT,Strings,PTUIMDef,PTUIMSE,PTUIVMSE,PTUIVCRT,KeyDef;
Const
MouseLeftButton = 0;
MouseRightButton = 1;
MouseMiddleButton= 2;
MouseGranularity = 8;
SpecialNIL = Ptr($FFFF,$FFFF);
Type
LineStyles = (DoubleLine,SingleLine,NoLine);
ShadowStyles = (LightHash,MediumHash,DarkHash,Solid,NoShade);
HideOrShow = (Hidden,Visible);
SlideBarInfo = Record
X1,Y1,X2,Y2 :Word;
Forg :Word;
Back :Word;
MainChar :Char;
ButtonChar :Char;
UpLeftChar :Char;
DownRightChar :Char;
CurPos :LongInt;
MaxPos :LongInt;
ButtonScreenPos :Word;
ButtonNum :Word;
BarButtonNum :Word;
ButtonLeftUpNum :Word;
ButtonRightDownNum :Word;
End;
ButtonListPtr = ^ButtonList; {Buttons to click on}
ButtonList = Record
X1,Y1,X2,Y2:Word; {Screen Co-ordinate}
Special :Boolean; {Keyboard Keys}
Key :Char; {Keyboard Character}
Number :Word; {It's own Unique Number}
Next :ButtonListPtr; {Next Button in Linked List}
End;
ButtonChain = Object
Total :Word;
Procedure Init;
Function Position :Word;
Function Number :Word;
Procedure GotoPosition (Here:Word);
Procedure GotoNumber (ButtonNumber:Word);
Procedure Add (X1, Y1, X2, Y2:Word;
Special:Boolean; Key:Char);
Procedure Move (X, Y:Integer;
ButtonNumber:Word);
Procedure MoveAll (X, Y:Integer);
Procedure WaitForClick (Var X, Y:Word;Var MouseButtons:Byte;
Var Held,Doubled,Special:Boolean;
Var Key:Char);
Procedure KillAll;
Procedure KillFrom;
Procedure KillOne;
Private
Root :Pointer;
Buttons :ButtonListPtr;
Function NewButtonNumber:Word;
End;
MouseFunctions = Object
Init :MouseProc_Init;
Show :MouseProc_Show;
Hide :MouseProc_Hide;
SetSpeed :MouseProc_SetSpeed;
SetXY :MouseProc_SetXY;
SetBounds :MouseProc_SetBounds;
GetPresses :MouseProc_GetPresses;
GetXY :MouseProc_GetXY;
GetStatus :MouseProc_GetStatus;
GetClick :MouseProc_GetClick;
Function ComputerSpeed:LongInt;
Function Active :Boolean;
End;
TextWindow = Object
VSlide :SlideBarInfo;
HSlide :SlideBarInfo;
HdrButtonNum :Word; {Button Numbers}
Buttons :ButtonChain; {The window's buttons}
Card :MonoOrColor;
Status :HideOrShow; {Visible or Not}
LineStyle :LineStyles; {Box Outline Style}
ShadowStyle :ShadowStyles; {Shadow Style}
ShadowXSize,
ShadowYSize,
BoxFrg, {Forg Colour}
BoxBck, {Back Colour}
ShdFrg, {Shadow Colour}
ShdBck,
HdrFrg, {Header Forg}
HdrBck :Byte; {Header Back}
Size, {Memory Required}
X1,Y1, {Location on Screen}
X2,Y2 :Word;
Header :String; {Heading Line}
HdrFmt :TextFormats; {Header Position}
Procedure Open(NX1,NY1,NX2,NY2:Word;Forg,Back,
ShadForg,ShadBack:Byte;
LStyle:LineStyles;SStyle:ShadowStyles);
Procedure DisplayHeading;
Procedure NewHeading(NewHead:String;NewMode:TextFormats;
Forg,Back:Byte);
Procedure Hide;
Procedure Show;
Procedure NewPosition(NewX,NewY:Word);
Procedure Drag;
Procedure DragVertSlideButton;
Procedure DragHorzSlideButton;
Procedure NewSize(NX1,NY1,NX2,NY2:Word);
Procedure NewStyle(Forg,Back,ShadForg,ShadBack:Byte;
LStyle:LineStyles;SStyle:ShadowStyles);
Procedure HeadingIcon (Active:Boolean);
Procedure VertSlideIcon (Active:Boolean);
Procedure DrawVertSlideBar;
Procedure VertSlideBar (Details:SlideBarInfo);
Procedure UpdateVertSlideBar (CurPos:LongInt);
Procedure HorzSlideIcon (Active:Boolean);
Procedure DrawHorzSlideBar;
Procedure HorzSlideBar (Details:SlideBarInfo);
Procedure UpdateHorzSlideBar (CurPos:LongInt);
Procedure HeadingPos (Var BX1,BY1,BX2,BY2:Word);
Procedure VertSlideBarPos (Var BX1,BY1,BX2,BY2:Word);
Procedure VertSlideButtonPos (Var BX1,BY1,BX2,BY2:Word);
Procedure VertSlideButtonUpPos (Var BX1,BY1,BX2,BY2:Word);
Procedure VertSlideButtonDownPos (Var BX1,BY1,BX2,BY2:Word);
Procedure HorzSlideBarPos (Var BX1,BY1,BX2,BY2:Word);
Procedure HorzSlideButtonPos (Var BX1,BY1,BX2,BY2:Word);
Procedure HorzSlideButtonLeftPos (Var BX1,BY1,BX2,BY2:Word);
Procedure HorzSlideButtonRightPos(Var BX1,BY1,BX2,BY2:Word);
Procedure Lock;
Procedure UnLock;
Procedure Close;
Private
Save :Pointer; {Memory Area for background}
Procedure SaveBackground;
Procedure DrawWindow;
End;
Procedure EnableVScreen(V